package com.ruoyi.consumer.aop.convert;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


//区分不同实现
@Service
public class RecordService {

    @Autowired
    private DefaultConvertStrategy strategyFactory;

    public Object takeOrder(Integer facilitId, Integer userId, Long amount, String snNumber, Long orderId, String userType) {
        ConvertStrategy strategy = strategyFactory.getStrategy(userType);
        return strategy.takeOrderOperate(facilitId, userId, amount, snNumber, orderId);
    }

    public Object getMinOrder(Long orderId, String userType) {
        ConvertStrategy strategy = strategyFactory.getStrategy(userType);
        return strategy.getMinOrderOperate(orderId);
    }

    public Object getWxOrder(String weixinOrderId, String userType) {
        ConvertStrategy strategy = strategyFactory.getStrategy(userType);
        return strategy.getWxOrderOperate(weixinOrderId);
    }

    public Object getWxMinOrder(Long orderId, String out_trade_no, String userType) {
        ConvertStrategy strategy = strategyFactory.getStrategy(userType);
        return strategy.getWxMinOrderOperate(orderId, out_trade_no);
    }
}
